package com.luck;

import cn.hutool.jwt.JWTUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

import java.util.HashMap;
import java.util.Map;

@SpringBootApplication
@EnableDiscoveryClient
public class GatewayAppApplication {

    public static void main(String[] args) {
        HashMap<String,String> mapToken = new HashMap<String,String>();
        //3.生成业务accessToken
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("id", 1);
        //手机号脱敏，这种实现不叫粗糙
        map.put("tel", "122323232");
        map.put("exp", System.currentTimeMillis()/1000 + 60*60*60*1); //业务token的有效期是1m
        String accessToken = JWTUtil.createToken(map, "lk".getBytes());
        SpringApplication.run(GatewayAppApplication.class, args);
    }

}
